package com.sgb.kjwl.model.entity.enterprise;

import com.google.gson.Gson;

import java.io.Serializable;

public class PublishCompanyDetailEntity implements Serializable {

    /**
     * id : 603
     * companyNo : null
     * companyName : null
     * transCompanyName : 182个人出售有限责任公司电子信息技术
     * socialCreditCode : aesfgqwegweeg
     * enterpriseType : 0
     * registeredCapital : 10000
     * foundedDate : 2021-03-25T08:11:09.077Z
     * registeredAddr : {"provinceId":130000,"provinceName":"河北省","cityId":130100,"cityName":"石家庄市","areaId":130104,"areaName":"桥西区"}
     * salePrice : -1.00
     * taxReturns : 1
     * taxScale : 0
     * contact : 请问无法为
     * phone : 18200110550
     * businessLicense : https://shigongbang.oss-cn-hangzhou.aliyuncs.com/member_center/610000/2021038416115971259372.jpg
     * otherInfo : null
     * operatingScope : null
     */

    private int id;
    private Object companyNo;
    private String companyName;
    private String transCompanyName;
    private String socialCreditCode;
    private String enterpriseType;
    private double registeredCapital;
    private String foundedDate;
    private String registeredAddr;
    private double salePrice;
    private int taxReturns;
    private int taxScale;
    private String contact;
    private String phone;
    private String businessLicense;
    private String otherInfo;
    private String operatingScope;
    private int status;
    private String industryName;
    private String industryType;
    private String mCategory;
    private String mCategoryName;

    public String getmCategory() {
        return mCategory;
    }

    public void setmCategory(String mCategory) {
        this.mCategory = mCategory;
    }

    public String getmCategoryName() {
        return mCategoryName;
    }

    public void setmCategoryName(String mCategoryName) {
        this.mCategoryName = mCategoryName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Object getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(Object companyNo) {
        this.companyNo = companyNo;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getTransCompanyName() {
        return transCompanyName;
    }

    public void setTransCompanyName(String transCompanyName) {
        this.transCompanyName = transCompanyName;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getEnterpriseType() {
        return enterpriseType;
    }

    public void setEnterpriseType(String enterpriseType) {
        this.enterpriseType = enterpriseType;
    }

    public double getRegisteredCapital() {
        return registeredCapital;
    }

    public void setRegisteredCapital(double registeredCapital) {
        this.registeredCapital = registeredCapital;
    }

    public String getFoundedDate() {
        return foundedDate;
    }

    public void setFoundedDate(String foundedDate) {
        this.foundedDate = foundedDate;
    }

    public String getRegisteredAddr() {
        return registeredAddr;
    }

    public void setRegisteredAddr(String registeredAddr) {
        this.registeredAddr = registeredAddr;
    }

    public double getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(double salePrice) {
        this.salePrice = salePrice;
    }

    public int getTaxReturns() {
        return taxReturns;
    }

    public void setTaxReturns(int taxReturns) {
        this.taxReturns = taxReturns;
    }

    public int getTaxScale() {
        return taxScale;
    }

    public void setTaxScale(int taxScale) {
        this.taxScale = taxScale;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getBusinessLicense() {
        return businessLicense == null ? "" : businessLicense;
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }

    public String getOtherInfo() {
        return otherInfo;
    }

    public void setOtherInfo(String otherInfo) {
        this.otherInfo = otherInfo;
    }

    public String getOperatingScope() {
        return operatingScope;
    }

    public void setOperatingScope(String operatingScope) {
        this.operatingScope = operatingScope;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getIndustryName() {
        return industryName;
    }

    public void setIndustryName(String industryName) {
        this.industryName = industryName;
    }

    public String getIndustryType() {
        return industryType;
    }

    public void setIndustryType(String industryType) {
        this.industryType = industryType;
    }

    public static class RegisteredAddrBean implements Serializable {
        /**
         * provinceId : 130000
         * provinceName : 河北省
         * cityId : 130100
         * cityName : 石家庄市
         * areaId : 130104
         * areaName : 桥西区
         */

        private int provinceId;
        private String provinceName;
        private int cityId;
        private String cityName;
        private int areaId;
        private String areaName;

        public int getProvinceId() {
            return provinceId;
        }

        public void setProvinceId(int provinceId) {
            this.provinceId = provinceId;
        }

        public String getProvinceName() {
            return provinceName;
        }

        public void setProvinceName(String provinceName) {
            this.provinceName = provinceName;
        }

        public int getCityId() {
            return cityId;
        }

        public void setCityId(int cityId) {
            this.cityId = cityId;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public int getAreaId() {
            return areaId;
        }

        public void setAreaId(int areaId) {
            this.areaId = areaId;
        }

        public String getAreaName() {
            return areaName;
        }

        public void setAreaName(String areaName) {
            this.areaName = areaName;
        }
    }

    public String getCompanyType(String enterpriseTy){
        if (enterpriseTy == null){
            return "";
        }
        //0:有限责任公司;1:个人独资公司;2:港澳台公司,3:集团公司"
        switch (enterpriseTy){
            case "0":
                return "有限责任公司";
            case "1":
                return "个人独资公司";
            case "2":
                return "港澳台公司";
            case "3":
                return "集团公司";
            default:
                return "";
        }
    }

    public String getTaxType(int tax){
        //0:有限责任公司;1:个人独资公司;2:港澳台公司,3:集团公司"
        switch (tax){
            case 0:
                return "小规模";
            case 1:
                return "一般纳税人";
            case 2:
                return "出口纳税人";
            case 3:
                return "未核税";
            default:
                return "";
        }
    }

    public String getAddress(String addr){
        if (addr != null){
            PublishCompanyDetailEntity.RegisteredAddrBean addrBean = new Gson().fromJson(addr,PublishCompanyDetailEntity.RegisteredAddrBean.class);
            return addrBean.getProvinceName()+addrBean.getCityName()+addrBean.getAreaName();
        }

        return "";
    }

    public RegisteredAddrBean getAddressPCA(String addr){
        if (addr != null){
            PublishCompanyDetailEntity.RegisteredAddrBean addrBean = new Gson().fromJson(addr,PublishCompanyDetailEntity.RegisteredAddrBean.class);
            return addrBean;
        }

        return null;
    }
}
